# -*- coding: utf-8 -*-
from __future__ import unicode_literals

# from django.db import models # 框架默认存储

# Create your models here.
import mongoengine
from mongoengine import connect
from mongoengine.document import Document
from mongoengine.fields import StringField, IntField
connect('xxbbj', host='localhost', port=27017)

class Users(Document):
  # username = mongoengine.StringField(max_length=100)
  # password = mongoengine.StringField(max_length=256)
  # realname = mongoengine.StringField(max_length=100)
  # phone = mongoengine.StringField(max_length=30)
  # status = mongoengine.StringField(max_length=3)
  username = mongoengine.StringField(max_length=100)
  # uid = mongoengine.StringField(max_length=256)
  # age = mongoengine.IntField(max_length=100)

def _print_records():
  # records = list(Users.objects.all())
  console.log('0000000000000000000000000000000000')
  return records

class Question(Document):
  question_text = mongoengine.StringField(max_length=200)
  pub_date = mongoengine.DateTimeField('date published')

class Choice(Document):
  # question = mongoengine.ForeignKey(Question, on_delete=models.CASCADE)
  choice_text = mongoengine.StringField(max_length=200)
  votes = mongoengine.IntField(default=0)